﻿using Project_Maverick.Controller.Input;
using Project_Maverick.GameRoot;
using Project_Maverick.Screen.Common;
using Transformable_Engine_v2.Engine;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Project_Maverick.Screen.Splash
{
    public class Splash : BaseScreen
    {
        private Background _background;

        public Splash()
        {
            _background = Background.Gray();
            AddChildren(_background);
            AddChildren(new StitchBackground(new TE_Vector2(36, 18)) { PositionGridBound = Game.Options.ScreenSize / 2 });
            base.LoadContent();
        }

        void ExitSplash()
        {
            ChangeScreen(ProjectMaverick.Screen.SelectGameMode, true);
            _background.Exit();
        }

        public override void ReceiveLocalInputPressed(PlayerInputCommand playerInputCommand)
        {
            if(playerInputCommand.Action == PlayerInput.Action.Accept)
                ExitSplash();
        }

        public override void ReceiveLocalInputReleased(PlayerInputCommand playerInputCommand)
        {
        }
    }
}